#include <iostream>
#include "Point"

Point *Point::_pInstance = nullptr;

Point *Point::getInstance()
{
    if(_pInstance == nullptr)
        _pInstance = new Point(0,0);

    return _pInstance;
}

void Point::init(int x, int y)
{
    _ix = x;
    _iy = y;
}

void Point::destroy()
{
    if(_pInstance){
        delete _pInstance;
        _pInstance = nullptr;
    }
}

void Point::display()
{
    std::cout << "(" << this->_ix
        << "," << this->_iy
        << ")" << std::endl;
}

Point::Point(int x, int y)
    : _ix(x)
      ,_iy(y)
{}

Point::~Point()
{
    /* this->destroy(); */
}
